<template>
  <div class="search__hot">
    <div class="search__hot--title">
      <span>热搜榜</span>
    </div>
    <ul class="search__hot--content">
      <li v-for="(item,index) in hotSearch" :key="index" @click="handleSearch(item.searchWord)">
        <mSearchHotItemVue :searchItem="item" :id="index"></mSearchHotItemVue>
      </li> 
    </ul>
  </div>
</template>
<script setup>
import mSearchHotItemVue from "./m-search-hot-item.vue";
import { defineProps,defineEmits } from "vue";
// 父组件传值
defineProps({
  hotSearch:Array
})
const emits = defineEmits(['click-hot'])
// 上传点击事件
const handleSearch = (val)=>{
  emits('click-hot',val)
}
</script>
<style lang="stylus">
.search__hot--title,
  display flex
  justify-content space-between
  font-size 14px
  font-weight 500
  margin-bottom 15px
</style>